home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 January / Disc 3 / Amethyst.iso / live / usr / share / vim / vim60 / ftplugin.vim < prev    next >
Encoding:
Text File  |  2002-06-19  |  660 b   |  24 lines

  1. " Vim support file to switch on loading plugins for file types
  2. "
  3. " Maintainer:    Bram Moolenaar <Bram@vim.org>
  4. " Last change:    2001 Oct 19
  5.  
  6. if exists("did_load_ftplugin")
  7.   finish
  8. endif
  9. let did_load_ftplugin = 1
  10.  
  11. augroup filetypeplugin
  12.   au FileType * call s:LoadFTPlugin()
  13.   func! s:LoadFTPlugin()
  14.     if expand("<amatch>") != ""
  15.       if &cpo =~# "S" && exists("b:did_ftplugin")
  16.     " In compatible mode options are reset to the global values, need to
  17.     " set the local values also when a plugin was already used.
  18.     unlet b:did_ftplugin
  19.       endif
  20.       runtime! ftplugin/<amatch>.vim ftplugin/<amatch>_*.vim ftplugin/<amatch>/*.vim
  21.     endif
  22.   endfunc
  23. augroup END
  24.